<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="keywords" content="广东国防教育学会">
    <meta name="description" content="广东国防教育学会">
    <title>广东国防教育学会</title>
    <link rel="shortcut icon" href="/Public/Admin/img/favicon.ico">
    <link href="/Public/Admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/Public/Admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/Admin/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" href="/Public/Admin/bootstrap_validator-0.4.5/dist/css/bootstrapValidator.css"/>
    <link href="/Public/Admin/css/animate.min.css" rel="stylesheet">
    <link href="/Public/Admin/plugins/iCheck/all.css" rel="stylesheet">
    <style>
		/* *{
			color:#000;
		} */
		.btn{
		 	 padding: 5px 8px;
		 	 /* border-radius: 0px; */
			font-size:12px;
			margin-bottom:0px;
		}
		.table{
	    	width: 100%;
		}
		.table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th, .table>thead>tr>td, .table>thead>tr>th{
			padding:0px 5px;
			/*text-align: center;*/
			vertical-align: middle!important;
		}
		.form-control{
			font-size: 12px;
		}
		#file-pretty button{
			padding: 7.5px 13px;
		}
		p{
	   		 margin: 0 0;
		}
		.pagination{
			margin:0px 0px;
		}
		.select_width{
			width:100px;
		}
		.select_no_border{
			border-right: none;
		}
	</style>
</head>
<style>
    #file-123 button{padding: 7.5px 15px 7.5px 15px;}
    #file-pretty1 button{padding: 7.5px 15px 7.5px 15px;}
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <?php if($act == 'add'): ?><h5>添加专家信息</h5>
                    <?php else: ?>
                    	<h5>修改申请信息</h5><?php endif; ?>
                    <div class="ibox-tools" style="margin-top: -6px;">
                        <!--<button onclick="history.go(-1);" class="btn btn-primary"><i class="fa fa-arrow-left"></i> 返回</button>-->
                        <a href="<?php echo U('applyList');?>" class="btn btn-primary"><i class="fa fa-arrow-left"></i> 返回</a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form enctype="multipart/form-data" action="/Admin/Apply/applyView" method="post" id="defaultForm" class="form-horizontal">
                        <?php if($act == 'add'): ?><div class="form-group">
                            <label class="col-sm-2 control-label">会员编号</label>
                            <div class="col-sm-6">
                                <input type="text" value="<?php echo ($data['user_id']); ?>" name="user_id" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div><?php endif; ?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">专家姓名</label>
                            <div class="col-sm-6">
                                <input type="text" value="<?php echo ($data['user_name']); ?>" name="user_name" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        
                        <div class="form-group">
                            <label class="col-sm-2 control-label">单位名称</label>
                            <div class="col-sm-6">
                                <input type="text" value="<?php echo ($data['job_name']); ?>" name="job_name" class="form-control">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">电话</label>
                            <div class="col-sm-6">
                                <input type="text" name="phone" class="form-control" value="<?php echo ($data['phone']); ?>">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">邮箱</label>
                            <div class="col-sm-6">
                                <input type="text" name="email" class="form-control" value="<?php echo ($data['email']); ?>">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <!--详情start-->
                        <div class="form-group">
                            <label class="col-sm-2 control-label">申请类型</label>
                            <div class="col-sm-6 i-check" style="line-height: 30px;">
                                <select name="type" class="form-control">
                                            <option value="">请选择专家类型</option>
                                            <?php if(is_array($category)): foreach($category as $key=>$category): ?><option <?php if($category['id'] == $data['type']): ?>selected<?php endif; ?> value="<?php echo ($category['id']); ?>"><?php echo ($category['name']); ?></option><?php endforeach; endif; ?>
                                        </select>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>


                        <div class="form-group"  id="trial_status_group">
                            <label class="col-sm-2 control-label">审核状态</label>
                            <div class="i-check col-sm-6" style="line-height: 30px;">
                                <input type="radio" name="status" value="2" <?php if($data['status'] == 2 || $data['status'] == '') echo 'checked="checked"'; ?> >&nbsp;待审核&nbsp;
                                <input type="radio" name="status" value="1" <?php if($data['status'] == 1) echo 'checked="checked"'; ?> >&nbsp;已通过&nbsp;
                                <input type="radio" name="status" value="3" <?php if($data['status'] == 3) echo 'checked="checked"'; ?> >&nbsp;不通过&nbsp;
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        
                        <div class="form-group reason_class" <?php if($data['status'] != 3): ?>style="display:none;"<?php endif; ?>>
                        <label class="col-sm-2 control-label">不通过原因</label>
                        <div class="col-sm-6">
                            <textarea name="reason" placeholder="请输入不通过原因" rows="5" class="form-control"><?php echo ($data['reason']); ?></textarea>
                        </div>
                    </div>
                         <div class="form-group" >
                            <label class="col-sm-2 control-label">是否推荐</label>
                            <div class="i-check col-sm-6" style="line-height: 30px;">
                                <input type="radio" name="is_top" value="0" <?php if($data['is_top'] == 0) echo 'checked="checked"'; ?> >&nbsp;否&nbsp;
                                <input type="radio" name="is_top" value="1" <?php if($data['is_top'] == 1) echo 'checked="checked"'; ?> >&nbsp;是&nbsp;
                                
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        
                <div class="hr-line-dashed reason_class" <?php if($data['status'] != 3): ?>style="display:none;"<?php endif; ?>></div>
                <div class="form-group">
                            <label class="col-sm-2 control-label">视频链接</label>
                            <div class="col-sm-6">
                                <input type="text" name="video_url" class="form-control" value="<?php echo ($data['video_url']); ?>">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 视频链接遵循http协议，如：http://www.baidu.com</span>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">一寸证件照</label>
                            <div class="col-sm-6">
                                <div id="file-pretty1">
                                    <input type="file" name="headimgurl" class="form-control">
                                    <input type="hidden" name="old_headimgurl" value="<?php echo ($data["headimgurl"]); ?>" />
                                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 温馨提示：图片尺寸建议为：413 X 295，图片小于1M</span>
                                    <?php if($data['headimgurl']): ?><a target="_blank" href="<?php echo ($data["headimgurl"]); ?>"><i class="fa fa-image fa-2x"></i></a><?php endif; ?>

                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">证明材料图片</label>
                            <div class="col-sm-6">
                                <div id="file-pretty">
                                    <input type="file" name="img">
                                    <input type="hidden" name="old_img" value="<?php echo ($data["img"]); ?>" />
                                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 温馨提示：图片尺寸建议为：600*600，图片小于4M</span>
                                    <!-- <div class="form-group">
                                        <label class="font-noraml">文件选择（多选）</label>
                                        <input type="file" multiple="multiple" class="form-control">
                                    </div> -->
                                    <?php if($data['img']): ?><a target="_blank" href="<?php echo ($data["img"]); ?>"><i class="fa fa-image fa-2x"></i></a><?php endif; ?>

                                </div>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">图片墙</label>
                            <div class="col-sm-6">
                            <div id="file-123">
                                    <input type="file" name="more_img[]" multiple="multiple">
                                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 温馨提示：图片尺寸建议为：600*600，图片小于4M，最多只能上传10张</span>
                                <div id="image1">
                                    <?php if($data['more_img']): if(is_array($data['more_img_list'])): $i = 0; $__LIST__ = $data['more_img_list'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><a target="_blank" href="<?php echo ($vo); ?>"><img src="<?php echo ($vo); ?>" style="width: 50px;height: 50px;margin-right: 6px;margin-top: 6px;"></a><?php endforeach; endif; else: echo "" ;endif; endif; ?>
                                </div>
                              </div>  
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" style="height:auto;">个人简介</label>
                            <div class="col-sm-10">
                                <textarea name="introduce" placeholder="个人简介" rows="5" class="form-control" style="width:80%"><?php echo ($data['introduce']); ?></textarea>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" style="height:auto;">个性签名</label>
                            <div class="col-sm-10">
                                <textarea name="signature" placeholder="个性签名" rows="5" class="form-control" style="width:80%"><?php echo ($data['signature']); ?></textarea>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label" style="height:auto;">补充说明</label>
                            <div class="col-sm-10">
                                <textarea name="explain" placeholder="补充说明" rows="5" class="form-control" style="width:80%"><?php echo ($data['explain']); ?></textarea>
                                <!--<script type="text/plain" id="editor" name="explain" style="width:80%;height:auto;"><?php echo (stripslashes(htmlspecialchars_decode($data["explain"]))); ?></script>-->
                            </div>
                        </div>
                        <!--详情end-->
                        <div class="hr-line-dashed"></div>
                        <input type="hidden" name="act" value="<?php echo ($act); ?>" />
                        <input type="hidden" name="id" value="<?php echo ($data['id']); ?>">
                        <input type="hidden" name="user_id" value="<?php echo ($data['user_id']); ?>">
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button id="save" class="btn btn-primary" type="submit">保存</button>
                                <button id="reset" class="btn btn-white" type="submit">取消</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</div>

<script src="/Public/Admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/Admin/js/bootstrap.min.js?v=3.3.6"></script>
<!-- <script src="/Public/Admin/js/content.min.js?v=1.0.0"></script> -->
<script type="text/javascript" src="/Public/Admin/bootstrap_validator-0.4.5/dist/js/bootstrapValidator.js"></script>
<script src="/Public/Admin/plugins/layer/layer.js"></script>
<script src="/Public/Admin/plugins/iCheck/icheck.min.js"></script>

<script>
//设置checkbox按钮
$('.i-check').iCheck({
	checkboxClass : "icheckbox_square-green",
	radioClass : "iradio_square-green",
});
</script>

</body>
</html>
<script src="/Public/Admin/js/plugins/prettyfile/bootstrap-prettyfile.js"></script>
<script type="text/javascript">
//显示图片路径
$(function(){
    $('#file-pretty input[type="file"]').prettyFile();
    $('#file-pretty .input-large').val('<?php echo ($data["img"]); ?>');
 })
 
 $(function(){
	    $('#file-123 input[type="file"]').prettyFile();
	    //$('.input-large').val('<?php echo ($data["img"]); ?>');
	 })
 $(function(){
	    $('#file-pretty1 input[type="file"]').prettyFile();
	    $('#file-pretty1 .input-large').val('<?php echo ($data["headimgurl"]); ?>');
	 })
</script>
<script>
	$("#defaultForm").submit(function(){
                 var headimgurl = $("input[name='headimgurl']").val();
		 var old_headimgurl = $("input[name='old_headimgurl']").val();
		 var img = $("input[name='img']").val();
                 var old_img = $("input[name='old_img']").val();
                 if((headimgurl == '') && (old_headimgurl == '')){
			 Zepto.toast('请上传一寸证件照！', 2000, 'success top');
			 return false;
		 }
		 if((img == '') && (old_img == '')){
			 Zepto.toast('请上传证明材料！', 2000, 'success top');
			 return false;
		 }

	});
	
	
</script>
<script>
    $("#trial_status_group .iCheck-helper").click(function(){
        if($(this).siblings("input").val() == 3){
            $(".reason_class").show();
        }else{
            $(".reason_class").hide();
        }
    });
</script>
 
<script src="/Public/ueditor/ueditor.config.js" type="text/javascript"></script>
<script src="/Public/ueditor/ueditor.all.js" type="text/javascript"></script>

<script>
    var ue = UE.getEditor('editor');
    // 自定义的编辑器配置项,此处定义的配置项将覆盖editor_config.js中的同名配置
    var editor_a = new baidu.editor.ui.Editor(editorOption);
    editor_a.render('editor');
</script>

<script>
    $(document).ready(function() {
        /**
         * 下面是进行插件初始化
         * 你只需传入相应的键值对
         * */
        $('#defaultForm').bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {/*输入框不同状态，显示图片的样式*/
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {/*验证*/
                user_name: {/*键名username和input name值对应*/
                    message: '专家姓名验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '专家姓名不能为空'
                        },
                        stringLength: {/*长度提示*/
                            min: 2,
                            max: 10,
                            message: '专家姓名长度必须在2到10之间'
                        }/*最后一个没有逗号*/
                    }
                },
                job_name: {/*键名username和input name值对应*/
                    message: '单位名称验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '单位名称不能为空'
                        }
//                        stringLength: {/*长度提示*/
//                            min: 1,
//                            max: 30,
//                            message: '奖品数量长度必须在1到30之间'
//                        }/*最后一个没有逗号*/
                    }
                },
                phone: {/*键名username和input name值对应*/
                    message: '电话号码验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '电话号码不能为空'
                        },
                        regexp: {
                            regexp: /^1[34578]\d{9}$/,
                            message: '手机号码格式不正确'
                        }
//                        stringLength: {/*长度提示*/
//                            min: 1,
//                            max: 30,
//                            message: '中奖概率长度必须在1到30之间'
//                        }/*最后一个没有逗号*/
                    }
                },
                email:{/*键名username和input name值对应*/
                    message: '邮箱验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '邮箱不能为空'
                        },
                        regexp: {
                            regexp: /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/ ,
                            message: '邮箱格式不正确'
                        }
                    }
                },
                type: {/*键名username和input name值对应*/
                    message: '专家类型验证失败',
                    validators: {
                        notEmpty: {/*非空提示*/
                            message: '请选择专家类型'
                        }
                    }
                }
            }
            // 还有一个比较常用的就是submitHandler属性，它对应着提交按钮的事件方法。
            // submitHandler: function (validator, form, submitButton) {
            //alert("submit");
            /*  var menu_name = $("input[name='menu_name']").val();
             var link = $("input[name='link']").val();
             var ico = $("input[name='ico']").val();
             $.ajax({
             url : '/Admin/Apply/addMenu',
             type : 'get',
             data : {'menu_name' : menu_name, 'link' : link, 'ico':ico},
             dataType : 'json',
             success : function(data){
             alert(data.message);
             }
             }); */
            // }
        });
    });

</script>


</body>
</html>